//package com.spring.test.zuul;
//
//import javax.servlet.http.HttpServletRequest;
//
//import org.springframework.stereotype.Component;
//
//import com.netflix.zuul.ZuulFilter;
//import com.netflix.zuul.context.RequestContext;
//
//@Component
//public class MyFilter extends ZuulFilter {
//    @Override
//    public String filterType() {
//        return "pre";
//    }
//
//    @Override
//    public int filterOrder() {
//        return 0;
//    }
//
//    @Override
//    public boolean shouldFilter() {
//        return true;
//    }
//
//    @Override
//    public Object run() {
////        RequestContext ctx = RequestContext.getCurrentContext();
////        HttpServletRequest request = ctx.getRequest();
////        System.err.println(
////            String.format("%s >>> %s", request.getMethod(), request.getRequestURL().toString()));
////        Object accessToken = request.getParameter("token");
////        if (accessToken == null) {
////            System.err.println("token is empty");
////            ctx.setSendZuulResponse(false);
////            ctx.setResponseStatusCode(401);
////            try {
////                ctx.getResponse().getWriter().write("token is empty");
////            } catch (Exception e) {
////            }
////
////            return null;
////        }
////        System.err.println("ok");
//        return null;
//    }
//}
